function getBird() {
  console.log("买一只鸟");
}

Function.prototype.before = function (fn) {
  console.log(this);
  return () => {
    fn.apply(this, arguments);
    return this.apply(this);
  };
};

Function.prototype.after = function (fn) {
  console.log(this);
  const that = this;
  return function () {
    const rst = that.apply(this);
    fn.apply(this);
    return rst;
  };
};

const fn = getBird
  .before(() => {
    console.log(`你有没有钱买一只鸟`);
  })
  .after(() => {
    console.log("有没有时间和鸟玩");
  });

fn();
